jq(document).ready(function(){
    initPage();
});
function initPage(){
    var app1 = new Vue({
        el : "#content",
        data : {
            deptList : [//部门列表
                {
                    id : "1",
                    deptImg : "img/2.png",
                    deptName : "产品部"
                },
                {
                    id : "2",
                    deptImg : "img/2.png",
                    deptName : "全面预算事业部"
                }
            ],
            showCrumbs : false,//是否是根目录
            crumbsList : [//面包屑目录
                {
                    deptId : "111",
                    deptName : "东华厚盾"
                },
                {
                    deptId : "2222",
                    deptName : "项目一部项目一部项目一部"
                }
            ]
        },
        methods : {
            selectedRow : function(id,deptName){
                var returnVal = {};
                returnVal["deptName"] = deptName;
                returnVal["deptId"] = id;
                appcan.window.publish("deptTree",returnVal);               
                appcan.window.close();
            },
            showLowerBtn : function(id){
                app1.deptList = [
                {
                    id : "1",
                    deptImg : "img/2.png",
                    deptName : "业务一部"
                },
                {
                    id : "2",
                    deptImg : "img/2.png",
                    deptName : "业务二部"
                }
                ];    
                app1.showCrumbs = true;         
            },
            returnsuper : function(index,deptId){
                if (index == app1.crumbsList.length-1) {
                    return false;
                }

                app1.deptList = [
                {
                    id : "1",
                    deptImg : "img/2.png",
                    deptName : "产品部"
                },
                {
                    id : "2",
                    deptImg : "img/2.png",
                    deptName : "全面预算事业部"
                }
                ];    
                app1.showCrumbs = false;         
            }
        }
    });
}
